﻿using System;
using System.Data;
using System.Collections.Generic;
using EnterpriseFund.Model;
namespace EnterpriseFund.BLL
{
    /// <summary>
    /// DJ_NSRXX
    /// </summary>
    public partial class DJ_NSRXX
    {
        private readonly EnterpriseFund.DAL.DJ_NSRXX dal = new EnterpriseFund.DAL.DJ_NSRXX();
        public DJ_NSRXX()
        { }
        #region  BasicMethod
        /// <summary>
        /// 是否存在该记录
        /// </summary>
        public bool Exists(decimal fyear, string noList, string type, string strWhere)
        {
            return dal.Exists(fyear, noList, type, strWhere);
        }

        public DataSet GetShowList(string strWhere, string strWhere2, string year,string strwhere3)
        {
            return dal.GetShowList(strWhere, strWhere2, year, strwhere3);
        }
                /// <summary>
        /// 获取审核数据
        /// </summary>
        /// <param name="PageSize"></param>
        /// <param name="PageIndex"></param>
        /// <param name="strWhere"></param>
        /// <param name="fOrderFiled"></param>
        /// <returns></returns>
        public DataSet GetDataforAudit(string beginDate, string endDate, string Year, string NSRDZDAH)
        {
            return dal.GetDataforAudit(beginDate, endDate, Year, NSRDZDAH);
        }


                /// <summary>
        /// 根据查询条件获取纳税人电子档案号
        /// </summary>
        /// <param name="fyear"></param>
        /// <param name="strwhere"></param>
        /// <returns></returns>
        public List<string> GetDzdah(string fyear, string strwhere)
        {
            return dal.GetDzdah(fyear, strwhere);
        }

        
        /// <summary>
        /// 数据导入
        /// </summary>
        /// <param name="list1"></param>
        /// <param name="list2"></param>
        public void ImportData(string strwhere = "1=1", int outTimes = 60*60)
        {
            dal.ImportData(strwhere);
        }

        public void AddALLPre(string strwhere, string fyear, Model.DJ_NSRXX_Extension1 model, string strWhere)
        {
            dal.AddALLPre(strwhere, fyear, model, strWhere);
        }

                /// <summary>
        /// 批量修改企业性质和资金性质
        /// </summary>
        /// <param name="model1"></param>
        public void AddALL(List<Model.DJ_NSRXX_Extension1> model1List, string noList)
        {
            dal.AddALL(model1List, noList);
        }
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public void Add(EnterpriseFund.Model.DJ_NSRXX_Extension1 model1, EnterpriseFund.Model.DJ_NSRXX_Extension2 model2)
        {
             dal.Add(model1,model2);
        }

        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(EnterpriseFund.Model.DJ_NSRXX model)
        {
            return dal.Update(model);
        }

        /// <summary>
        /// 删除一条数据
        /// </summary>
        public bool Delete(decimal NSRDZDAH)
        {

            return dal.Delete(NSRDZDAH);
        }
        /// <summary>
        /// 删除一条数据
        /// </summary>
        public bool DeleteList(string NSRDZDAHlist)
        {
            return dal.DeleteList(NSRDZDAHlist);
        }

        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public EnterpriseFund.Model.DJ_NSRXX GetModel(decimal NSRDZDAH,string fyear)
        {
            return dal.GetModel(NSRDZDAH, fyear);
        }

        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public EnterpriseFund.Model.DJ_NSRXX GetModelByNSRBM(string NSRBM, string fyear)
        {

            return dal.GetModelByNSRBM(NSRBM, fyear);
        }
        public EnterpriseFund.Model.DJ_NSRXX GetModelByNSRBM(string NSRBM)
        {
            return dal.GetModelByNSRBM(NSRBM);
        }
        public EnterpriseFund.Model.DJ_NSRXX GetModelByNsrsbh(string NSRSBH)
        {
            return dal.GetModelByNsrsbh(NSRSBH);
        }
        public EnterpriseFund.Model.DJ_NSRXX GetModelByNSRBMAndNsrmc(string NSRBM, string NSRMC)
        {

          return  dal.GetModelByNSRBMAndNsrmc(NSRBM, NSRMC);
        }
        public EnterpriseFund.Model.DJ_NSRXX GetModelByNsrmcAndNsrsbh(string NSRMC, string NSRSBH)
        {

            return dal.GetModelByNsrmcAndNsrsbh(NSRMC, NSRSBH);
        }
        public EnterpriseFund.Model.DJ_NSRXX GetModelByNSRBMAndNsrmcAndNsrsbh(string NSRBM, string NSRMC, string NSRSBH)
        {
            return dal.GetModelByNSRBMAndNsrmcAndNsrsbh(NSRBM, NSRMC, NSRSBH);
        }
        public EnterpriseFund.Model.DJ_NSRXX GetModelByNSRBMlike(string NSRBM, string fyear)
        {

            return dal.GetModelByNSRBMlike(NSRBM, fyear);
        }


        /// <summary>
        /// 获得数据列表
        /// </summary>
        public DataSet GetList(string strWhere)
        {
            return dal.GetList(strWhere);
        }
        /// <summary>
        /// 获得前几行数据
        /// </summary>
        public DataSet GetList(int Top, string strWhere, string filedOrder)
        {
            return dal.GetList(Top, strWhere, filedOrder);
        }
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List<EnterpriseFund.Model.DJ_NSRXX> GetModelList(string strWhere)
        {
            DataSet ds = dal.GetList(strWhere);
            return DataTableToList(ds.Tables[0]);
        }

                /// <summary>
        /// 获得数据列表
        /// </summary>
        public string GetFDDBRMC(string NSRDZDAH)
        {
            return dal.GetFDDBRMC(NSRDZDAH);
        }
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List<EnterpriseFund.Model.DJ_NSRXX> DataTableToList(DataTable dt)
        {
            List<EnterpriseFund.Model.DJ_NSRXX> modelList = new List<EnterpriseFund.Model.DJ_NSRXX>();
            int rowsCount = dt.Rows.Count;
            if (rowsCount > 0)
            {
                EnterpriseFund.Model.DJ_NSRXX model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = dal.DataRowToModel(dt.Rows[n]);
                    if (model != null)
                    {
                        modelList.Add(model);
                    }
                }
            }
            return modelList;
        }

        /// <summary>
        /// 获得数据列表
        /// </summary>
        public DataSet GetAllList()
        {
            return GetList("");
        }

        /// <summary>
        /// 分页获取数据列表
        /// </summary>
        public int GetRecordCount(string strWhere,string fYear)
        {
            return dal.GetRecordCount(strWhere, fYear);
        }
        /// <summary>
        /// 分页获取数据列表
        /// </summary>
        public DataSet GetListByPage(string strWhere, string orderby, int startIndex, int endIndex)
        {
            return dal.GetListByPage(strWhere, orderby, startIndex, endIndex);
        }
        /// <summary>
        /// 分页获取数据列表
        /// </summary>
        //public DataSet GetList(int PageSize,int PageIndex,string strWhere)
        //{
        //return dal.GetList(PageSize,PageIndex,strWhere);
        //}

        #endregion  BasicMethod
        #region  ExtensionMethod

        #endregion  ExtensionMethod
    }
}

